import { BaseResponse, AjaxRequest } from '@/api'
const fetch = new AjaxRequest({
  baseURL: 'https://api.xiwang.com',
})
const baseURL = import.meta.env.VITE_NODE_ENV === 'development' ? '/' : 'https://bcc.xiwang.com'
// 登录获取token
export function getToken(data: any) {
  return fetch._ajax({
    baseURL,
    url: `/api/login/LoginV1/getToken?X-Businessline-Id=30`,
    method: 'get',
    params: data,
  })
}

// 校验登录状态, check_rfh 0字段禁止校验旧token逻辑
export const checkLogin = () => {
  return fetch._ajax({
    baseURL,
    url: `/api/login/V1/Web/checkLogin?X-Businessline-Id=30`,
    method: 'get',
    params: { user_info: 1, check_rfh: 0 },
  })
}
